import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/admin'
    },
    {
      path:'/cs',
      name:'cs',
      component:()=>import('../page/cs.vue')
    },
    {
      path:'/detail/:id',
      name:'detail',
      component:()=>import('../page/detail.vue')
    },
    {
      path:'/gouwu',
      name:'gouwu',
      component:()=>import('../page/gouwu.vue')
    },
    {
      path:'/admin',
      name:'admin',
      redirect:'/admin/one',
      component:()=>import('../page/admin.vue'),
      children:[
        {
          path:'one',
          name:'one',
          component:()=>import('../components/adminOne.vue')
        },
        {
          path:'two',
          name:'two',
          component:()=>import('../components/fenlei.vue')
        },
        {
          path:'three',
          name:'three',
          component:()=>import('../components/fenleiSearch.vue')
        },
        {
          path:'/my',
          name:'my',
          component:()=>import('../page/my.vue')
        },
      ]
    },
    {
      path:'/login',
      name:'denglu',
      redirect:"/login/denglu",
      children:[
            {
              path:'zhuce',
              name:'zhuce',
              component:() => import('../components/zhuce.vue')
            },
            {
              path:'denglu',
              name:'childDenglu',
              component:() => import('../components/denglu.vue')
            },
      ]
    },
    {
      path:'/founding',
      name:'founding',
      component:()=>import('../page/founding.vue')
    },
    {
      path:'/founded',
      name:'founded',
      component:()=>import("../page/founded.vue")
    },

    {
      path:'/zl',
      name:'zl',
      component:()=>import('../components/myZL.vue')
    },
    {
      path:'/changePass',
      name:'changePass',
      component:()=>import('../page/changePass.vue')
    },
    {
      path:'/ress',
      name:'ress',
      component:()=>import('../page/ress.vue'),
      redirect:"/ress/set",
      children:[
        {
          path:'add',
          name:'add',
          component:()=>import('../components/addRess.vue')
        },
        {
          path:'set',
          name:'set',
          component:()=>import("../components/setRess.vue")
        },{
          path:'change/:id',
          name:'change',
          component:()=>import('../components/cRess.vue')
        }
      ]
    },
    {
      path:'/dingdan',
      name:'dingdan',
      redirect:'/dingdan/xingxi',
      component:()=>import('../page/dingdan.vue'),
      children:[
        {
          path:'confirm',
          name:'dingdanConfirm',
          component:()=>import('../components/confirm.vue')
        },
        {
          path:'xingxi',
          name:'dingdanxingxi',
          component:()=>import('../components/xingxi.vue')
        },
        {
          path:'xiangqing/:id',
          name:"dingdanxiangqing",
          component:()=>import('../components/xiangqing.vue')
        }
      ]
    },
    {
      path:'/pj/:id',
      name:'pj',
      component:()=>import('../page/pj.vue')
    },
    {
      path:'/username',
      name:"username",
      component:()=>import("../components/changeName.vue")
    }
  ]
})

export default router
